package com.uniview.service.impl;

import com.uniview.dao.LoginLogDao;
import com.uniview.dao.ResourceRoleDao;
import com.uniview.dao.RoleDao;
import com.uniview.dao.UserRoleDao;
import com.uniview.entity.po.LoginLog;
import com.uniview.entity.po.ResourceRole;
import com.uniview.entity.po.Role;
import com.uniview.entity.po.UserRole;
import com.uniview.entity.vo.Pager;
import com.uniview.entity.vo.QueryBuilder;
import com.uniview.entity.vo.ResultMessage;
import com.uniview.service.LoginLogService;
import com.uniview.service.RoleService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户登录日志业务接口实现类
 * 
 * @author anconglee
 *
 */
@Service("loginlogService")
public class LoginLogServiceImpl implements LoginLogService {

	Logger logger = Logger.getLogger(LoginLogServiceImpl.class);

	@Autowired
	private LoginLogDao loginLogDao;


	@Override
	public int saveLoginLog(LoginLog loginLog) {
		try {
			return loginLogDao.saveLoginLog(loginLog);
		} catch (Exception e) {
			logger.error("记录用户登录日志异常", e);
		}
		return 0;
	}

	@Override
	public Pager<LoginLog> findLoginLogByPager(QueryBuilder queryBuilder, int pageNo,int pageSize) {
		try {
			return loginLogDao.findLoginLogByPage(queryBuilder,pageNo,pageSize);
		} catch (Exception e) {
			logger.error("查询用户登录日志异常", e);
		}
		return null;
	}
}
